<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<script type="text/javascript">
    function changeStatusAction(submitAction) {
        afterSubmitRedirect("user", "changestatus.html", submitAction, "submitAction");
    }
</script>

<!-- Menu -->
<jsp:include page="menu.jsp"/>

<div class="sub_nav">
    <ul>
        <li>
            <a href="#">
                <img src="<%= request.getContextPath()%>/images/menu/sub_general_on.gif" alt="gernal"/>
            </a>
        </li>
    </ul>
</div>
<!--END: Subnav -->

<!--START: conent -->
<div class="content2">
    <div class="insider">
        <div class="corners">
            <div class="corners_top"></div>
            <form id="user" method="post">
                <div class="column1">
                    <div class="col_l">
                        <!-- Mark the type of the submit action -->
                        <input type="hidden" id="submitAction" name="submitAction"/>

                        <table width="360" border="0" cellspacing="4" class="formlayout_table">
                            <tr>
                                <th width="172"><label>User ID:</label></th>
                                <td width="172" class="bg_n">
                                    ${user.username}
                                </td>
                            </tr>

                            <tr>
                                <th><label>First Name:</label></th>
                                <td class="bg_n">
                                    ${user.firstname}
                                </td>
                            </tr>

                            <tr>
                                <th><label>Last Name:</label></th>
                                <td class="bg_n">
                                    ${user.lastname}
                                </td>
                            </tr>

                            <tr>
                                <th><label>Email:</label></th>
                                <td class="bg_n">
                                    ${user.email}
                                </td>
                            </tr>

                            <tr>
                                <th><label>Group:</label></th>
                                <td>
                                    ${user.userGroup.name}
                                </td>
                            </tr>

                            <tr>
                                <th width="172"><label>Enabled / Disabled:</label></th>
                                <td width="172">
                                    <select name="enabled" class="select1">
                                        <option value="true" ${user.enabled ? 'selected' : ''}>Enabled</option>
                                        <option value="false" ${not user.enabled ? 'selected' : ''}>Disabled</option>
                                    </select>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <table width="360" border="0" cellspacing="4" class="formlayout_table fr">
                        <tr>
                            <th width="140"><label>Disabled By:</label></th>
                            <td>${user.disabledBy}</td>
                        </tr>

                        <tr>
                            <th><label>Disabled Date:</label></th>
                            <td>
                                <fmt:formatDate value="${user.disabledOn}" pattern="dd-MMM-yyyy"/>
                            </td>
                        </tr>

                        <tr>
                            <th><label>Disable Notes:</label></th>
                            <td>
                                <textarea name="disabledNote" class="textarea1" rows="5" cols="1"
                                          style="width: 220px">${user.disabledNote}</textarea>
                            </td>
                        </tr>
                    </table>
                </div>
            </form>
            <!-- Function1 -->
            <ul class="functions1">
                <li>
                    <a href="#" onclick="changeStatusAction('submit');">
                        <img src="<%= request.getContextPath()%>/images/btn/functions1/btn_save.gif" class="btn"/>
                    </a>
                </li>
                <li>
                    <a href="#" onclick="Dialogs.unescapedLink('cancel.html', 'from')">
                        <img src="<%= request.getContextPath()%>/images/btn/functions1/btn_cancel.gif" class="btn"/>
                    </a>
                </li>
            </ul>

            <div class="corners_bottom"></div>
        </div>

        <div class="message">
            ${message}
            ${empty message ? '' : '<br />'}

            <div style="color:red">
                ${disabledNoteError}
                ${empty disabledNoteError ? '' : '<br />'}
            </div>
        </div>
    </div>
</div>
<!--END: conent -->